<?php

namespace App\Controller\App;


use App\Base\BaseConfig;
use App\Base\BaseController4App;
use Symfony\Component\Routing\Annotation\Route;

/**
 * @route("/app")
 */
class UserShareController extends BaseController4App
{
    /**
     * @Route("/user/share/info", name="AppUserShareInfo")
     */
    public function AppUserShareInfo()
    {
        $user = $this->needToBeUser();
        $data["user"] = $user;
        $regUrl = BaseConfig::__BASE_URL__ ."/miniappreg?code=".$user->getOpenid();
        $shareCode =  BaseConfig::__BASE_URL__ . $this->generateUrl("Qr", array("code"=> $regUrl));
        $data["code"] = $shareCode;
        $this->setGroups("home","user");
        return $this->json_out(1, "数据获取成功", $data);
    }
}
//https://jiayou.sano100.com/miniappreg?code=